// 人员管理指令
define('staffSelectDirective', ['angular'], function (angular) {
    var m = angular.module('directives');
    m.directive('staffSelect', ['companyServers',function (companyServers) {
    	return {
            restrict: 'AE',
            templateUrl: 'js/templates/staffSelect.html',
            replace: true,
            scope:{
                currentId:"=?",
            },
            controller:['$scope','$rootScope',function($scope,$rootScope){
                $scope.user=angular.copy($rootScope.user);
                $scope.type=[
                    {id:1,type:'销售人员'},
                    {id:2,type:'渠道经理'},
                    {id:3,type:'经理'},
                    {id:4,type:'副总'}
                ];
                for(var i=0;i<$scope.type.length;i++){
                    if($scope.type[i].id<$scope.user.type){
                        $scope.type[i].floor=true;
                    }else{
                        $scope.type[i].floor=false;
                    }
                }
            }]
        };
    }]);
});